{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style type="text/css">
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
    }

    .asdlkjasd {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar" style="text-align: center;margin-bottom: 20px">
                        <h2><font color="#1ab394"><a href="{:url('proxy/index/index')}" style="color: #1ab394" target="_blank">代理后台</a></font></h2>
                    </div>
                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form method="get" action="" style="display: flex;">
                            <div class="pull-left search" style="display: flex;">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="search">
                                        <option value="topup" {php}if(input(
                                        '?param.search')){if(input('param.search')=='topup'){echo "selected";}
                                        }{/php}>总充值金额</option>
                                        <option value="sum_user" {php}if(input(
                                        '?param.search')){if(input('param.search')=='sum_user'){echo "selected";}
                                        }{/php}>总注册用户</option>
                                        <option value="cost_user" {php}if(input(
                                        '?param.search')){if(input('param.search')=='cost_user'){echo "selected";}
                                        }{/php}>总付费人数</option>
                                        <option value="new_user" {php}if(input(
                                        '?param.search')){if(input('param.search')=='new_user'){echo "selected";}
                                        }{/php}>新增用户</option>
                                        <option value="new_topup" {php}if(input(
                                        '?param.search')){if(input('param.search')=='new_topup'){echo "selected";}
                                        }{/php}>新增充值金额</option>
                                        <option value="new_cost_user" {php}if(input(
                                        '?param.search')){if(input('param.search')=='new_cost_user'){echo "selected";}
                                        }{/php}>新增付费人数</option>
                                    </select>
                                </div>

                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="order">
                                        <option value="desc" {php}if(input(
                                        '?param.order')){if(input('param.order')=='desc'){echo "selected";}
                                        }{/php}>降序</option>
                                        <option value="asc" {php}if(input(
                                        '?param.order')){if(input('param.order')=='asc'){echo "selected";}
                                        }{/php}>升序</option>
                                    </select>
                                </div>

                                <!--<div class="pull-right search">
                                    <input class="form-control input-outline" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }
                                    }
                                    {/php}
                                    name="name" placeholder="搜索会员">
                                </div>-->



                                <input name="start" type="text" id="start" class="form-control layui-input" value="{present name='start'}{$start}{/present}" placeholder=" # 起始时间" autocomplete="off" style="height:34px;width:100px;margin:0 10px;">
                                <input name="end" type="text" id="end" class="form-control layui-input" value="{present name='end'}{$end}{/present}" placeholder=" # 结束时间" autocomplete="off" style="height:34px;width:100px;margin:0 10px;">

                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>

                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('lists')}">返回管理</a>
                                </div>
                                {php}
                                }
                                {/php}
                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center">渠道ID</th>
                                    <!--<th data-align="center">头像</th>-->
                                    <th data-align="center">所属人</th>
                                    <th data-align="center">总注册用户</th>
                                    <th data-align="center">总充值金额</th>
                                    <th data-align="center">总付费人数</th>
                                    <th data-align="center">新增用户</th>
                                    <th data-align="center">新增充值金额</th>
                                    <th data-align="center">新增付费人数</th>
                                    <th data-align="center">VIP分成(%)</th>
                                    <th data-align="center">充值分成(%)</th>
                                    <th data-align="center">聊天分成(%)</th>
                                    <th data-align="center">状态</th>
                                    <th data-align="center">管理</th>
                                </tr>
                                </thead>
                                <tbody id="form">
                                {php}$hide=array('0'=>'<font color="#1ab394">正常</font>','1'=>'<font color="#f00">冻结</font>');{/php}
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <!--<td>
                                        <a href="__ROOT__{$v.head_100}" title="{$v.name}" target="_blank">
                                            <img style="width:40px;height:40px;" src="__ROOT__{$v.head_100}"/>
                                        </a>
                                    </td>-->
                                    <td><a onclick="member('{$v.id}')" style="color:#40BCF7">{$v.name}</a><br/>{if condition='$v.phone'}({$v.phone}){/if}</td>
                                    <td><a onclick="proxy('{$v.yqm}', 1)" style="color:#40BCF7">{$v.sum_user}</a></td>
                                    <td>{$v.topup}</td>
                                    <td><a onclick="proxy('{$v.yqm}', 2)" style="color:#40BCF7">{$v.cost_user}</a></td>
                                    <td><a onclick="proxy('{$v.yqm}', 3)" style="color:#40BCF7">{$v.new_user}</a></td>
                                    <td>{$v.new_topup}</td>
                                    <td><a onclick="proxy('{$v.yqm}', 4)" style="color:#40BCF7">{$v.new_cost_user}</a></td>
                                    <td>{$v.fencheng_vip * 100}</td>
                                    <td>{$v.fencheng_topup * 100}</td>
                                    <td>{$v.fencheng_chat * 100}</td>
                                    <td id="hide">{$hide[$v['is_banned']]}</td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                                操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onClick="add('{:url('add',['id'=>$v['id'],'url'=>-1])}')">修改</a></li>
                                                <li class="divider"></li>
                                                <li><a onClick="del({$v.id})" style="color:red">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    function del(id) {
        swal_del(id, "{:url('member/del')}")
    }
    layui.use(['laydate'], function(){
        var laydate = layui.laydate;

        laydate.render({
            elem: '#start' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });

        laydate.render({
            elem: '#end' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });
    })

    function proxy(id,channel)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("admin/member/index")}?proxy='+id+'&channel='+channel
            });
        });
    }

    function member(id)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("member/index")}?search=id&name='+id
            });
        });
    }
</script>
 